package patrol.mobile.com.mobilepatrol.activity.security.adapter;

import android.content.Context;
import android.text.TextUtils;

import com.dl7.recycler.adapter.BaseQuickAdapter;
import com.dl7.recycler.adapter.BaseViewHolder;

import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.bean.HistoryBean;
import patrol.mobile.com.mobilepatrol.utils.DateUtil;

/**
 * Created by admin on 2018/9/9.
 */

public class EmergencyPackageEdit1Adapter extends BaseQuickAdapter<HistoryBean> {


    public EmergencyPackageEdit1Adapter(Context context) {
        super(context);
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.item_emergency_package_edit1_list;
    }

    @Override
    protected void convert(final BaseViewHolder holder, HistoryBean item) {
        holder.setText(R.id.tv_num, (holder.getAdapterPosition() + 1) + "");
        holder.setText(R.id.tv_householder, item.getHouseholder());
        holder.setText(R.id.tv_houseRented, item.getHouseRented().equals("") ? "是" : "否");
        holder.setText(R.id.tv_keyPersonel, item.getKeyPersonel().equals("1") ? "是" : "否");
        holder.setText(R.id.tv_isHas, item.getIsHas());
        holder.setText(R.id.tv_solver, item.getSolver());

        holder.setText(R.id.tv_reportDate, DateUtil.long2string(DateUtil.format1,Long.parseLong(item.getReportDate())));
        holder.setText(R.id.tv_auditName, TextUtils.isEmpty(item.getAuditName()) ? "未审核" : item.getAuditName());
    }
}
